﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CBE.Services;
using CBE.Model;
using CBE.Model.Entities;
using Common.UI.EM.Views;
using Common.UI.EM.Views.Interfaces;
using Microsoft.Practices.Composite.Presentation.Commands;

namespace CBE.UI.Control
{
    public class AdministrarVentasDetailPresentationModel : DetailPresentationModel<AdministrarVentasService, Ventas, AdministrarVentasCriteria, AdministrarVentasView>
    {

        public event EventHandler ClienteNuevoCalled;

        public DelegateCommand<Object> ClienteNuevoCommand
        {
            get;
            set;
        }

        public AdministrarVentasDetailPresentationModel(IDetailView view)
            : base(view)
        {
        }

        protected override void AddCustomCommands()
        {
            this.ClienteNuevoCommand = new DelegateCommand<object>(ExecuteClienteNuevoCommand, CanExecuteClienteNuevoCommand);
        }

        void ExecuteClienteNuevoCommand(Object args)
        {
            if (ClienteNuevoCalled != null)
            {
                ClienteNuevoCalled(this, new EventArgs());
            }
        }

        Boolean CanExecuteClienteNuevoCommand(Object args)
        {
            return true;
        }

    }
}
